<?xml version="1.0" encoding="utf-8"?>
<openerp>
	<data>
  
	<menuitem name="Reporting"
         id="menu_project_report"
         parent="base.menu_main_pm"
         sequence="10"/>
	
<!--Project Task Inherit-->
		<record id="project_invoice_form_bf" model="ir.ui.view">
			<field name="name">project.batamfast</field>
			<field name="model">project.project</field>
			<field name="inherit_id" ref="project_timesheet.project_invoice_form"/>
			<field name="arch" type="xml">
				<field name="partner_id" on_change="onchange_partner_id(partner_id)" string="Customer" position="replace">
            		<field name="partner_id" on_change="onchange_partner_id(partner_id)" string="Customer" domain="[('customer','=',True)]" required="1"/>
            	</field>
				<field name="use_timesheets" class="oe_inline" position='replace'>
					<field name="use_timesheets" class="oe_inline" invisible="1"/>
				</field>
				<label for="use_timesheets" position='replace'>
					<label for="use_timesheets" invisible="1"/>
				</label>
			</field>
		</record>

		<record id="edit_project_bf" model="ir.ui.view">
			<field name="name">project.project.form.bf</field>
			<field name="model">project.project</field>
			<field name="inherit_id" ref="project.edit_project"/>
			<field name="arch" type="xml">
				<div name="buttons" position="replace">
					<div class="oe_right oe_button_box" name="buttons" groups="project.group_project_manager">
	                    <button class="oe_inline oe_stat_button" type="action" attrs="{'invisible':[('use_tasks','=', 0)]}"
	                        name="%(project.act_project_project_2_project_task_all)d" icon="fa-tasks">
	                        <field string="Tasks" name="task_count" widget="statinfo"/>
	                    </button>
	                    <button  class="oe_inline oe_stat_button" name="attachment_tree_view"  type="object" icon="fa-files-o">
	                        <field string="Documents" name="doc_count" widget="statinfo"/>
	                    </button>
	                    <button class="oe_inline oe_stat_button" name="open_timesheets" type="object" attrs="{'invisible':[('use_timesheets','=', 0)]}"
                        	icon="fa-calendar" string="Timesheets" invisible="1"/>
	                </div>
				</div>
				<xpath expr='//page[@string="Team"]' position='replace'/>
				<group name="group_alias" position='replace'>
					<group name="group_alias"
                                invisible="1">
                            <label for="alias_name" string="Email Alias"/>
                            <div name="alias_def">
                                <field name="alias_id" class="oe_read_only oe_inline"
                                        string="Email Alias" required="0"/>
                                <div class="oe_edit_only oe_inline" name="edit_alias" style="display: inline;" >
                                    <field name="alias_name" class="oe_inline"/>@<field name="alias_domain" class="oe_inline" readonly="1"/>
                                </div>
                            </div>
                            <label for="alias_model" string="Incoming Emails create"/>
                            <field name="alias_model" class="oe_inline" nolabel="1"/>
                            <field name="alias_contact" class="oe_inline"
                                    string="Accept Emails From"/>
                        </group>
				</group>
				<field name="resource_calendar_id" position='replace'>
					<field name="resource_calendar_id" invisible="1"/>
				</field>
				<field name="use_tasks" class="oe_inline" position='replace'>
					<field name="use_tasks" class="oe_inline" invisible="1"/>
				</field>
				<label for="use_tasks" position='replace'>
					<label for="use_tasks" string="Use Tasks" invisible="1"/>
				</label>

				<field name="parent_id" position='replace'>
					<field name="parent_id" string="Parent" 
					help="Append this project to another one using analytic accounts hierarchy" 
					invisible="1"
					domain="[('id','!=',analytic_account_id)]" context="{'current_model': 'project.project'}" />
				</field>
				<group string="Administration" position="replace">
					<group string="Administration" invisible="1">
	                     <field name="privacy_visibility" widget="radio"/>
	                     <field name="planned_hours" widget="float_time"
	                             groups="project.group_time_work_estimation_tasks"/>
	                     <field name="effective_hours" widget="float_time"
	                             groups="project.group_time_work_estimation_tasks"/>
	                     <field name="resource_calendar_id"
	                             groups="project.group_time_work_estimation_tasks"/>
					</group>
				</group>
				<button name="set_pending" position="replace">
					<button name="set_pending" string="Pending" type="object" states="open" invisible="1" groups="base.group_user"/>
				</button>
                <button name="set_template" position="replace">
					<button name="set_template" string="Set as Template" type="object" states="open" invisible="1" groups="base.group_user"/>
				</button>
				<button name="set_done" position="replace">
					<button name="set_done" string="Close Project" type="object" states="open,pending" groups="project.group_project_manager"/>
				</button>
                <button name="set_cancel" position="replace">
					<button name="set_cancel" string="Cancel Project" type="object" states="open,pending" groups="project.group_project_manager"/>
				</button>
			</field>
		</record>
		

		<record id="view_task_search_form_bf" model="ir.ui.view">
			<field name="name">project.task.search.form.bf</field>
			<field name="model">project.task</field>
			<field name="inherit_id" ref="project.view_task_search_form"/>
			<field name="arch" type="xml">
				<field name="user_id" position="replace">
					<field name="user_ids"/>
				</field>
				<filter string="My Tasks" position="replace">
					<filter string="My Tasks" domain="[('user_ids','=',uid)]"/>
				</filter>
				<filter string="Unassigned" position="replace">
					<filter string="Unassigned" name="unassigned" domain="[('user_ids', '=', False)]"/>
				</filter>
				<filter string="Assigned to" position="replace"/>
			</field>
		</record>
		
		<record id="view_task_form2_bf" model="ir.ui.view">
			<field name="name">project.task.form.bf</field>
			<field name="model">project.task</field>
			<field name="inherit_id" ref="project.view_task_form2"/>
			<field name="arch" type="xml">
				<field name="project_id" position="replace">
					<field name="project_id" domain="[('state','not in', ('close', 'cancelled'))]" required="1" on_change="onchange_project(project_id)" context="{'default_use_tasks':1}"/>
				</field>
				<field name="user_id" position="replace"/>
				<field name="reviewer_id" position="replace">
					<field name="reviewer_id" invisible="1"
                       options='{"no_open": True}'
                       context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_user']}"/>
                </field>
                <xpath expr='//notebook/page[@string="Description"]/field[@name="work_ids"]/tree/field[@name="name"]' position='replace'>
					<field name="name" invisible="1"/>
					<field name="work_summary" widget="selection"/>
				</xpath>
                <xpath expr='//notebook/page[@string="Description"]/field[@name="work_ids"]/tree/field[@name="user_id"]' position='after'>
					<field name="type"/>
					<field name="department"/>
				</xpath>
                <xpath expr='//page[@string="Description"]' position='after'>
					<page string="Assigned To" name="assigned">
                        <field colspan="4" name="user_ids" widget="many2many_kanban" context="{'default_groups_ref': ['base.group_user', 'base.group_partner_manager', 'project.group_project_user']}">
                            <kanban quick_create="false" create="true" delete="true">
                                <field name="name"/>
                                <templates>
                                    <t t-name="kanban-box">
                                        <div style="position: relative">
                                            <a t-if="! read_only_mode" type="delete" style="position: absolute; right: 0; padding: 4px; diplay: inline-block">X</a>
                                            <div class="oe_module_vignette">
                                                <img t-att-src="kanban_image('res.users', 'image_small', record.id.value)" class="oe_avatar oe_kanban_avatar_smallbox"/>
                                                <div class="oe_module_desc">
                                                    <field name="name"/>
                                                </div>
                                            </div>
                                        </div>
                                    </t>
                                </templates>
                            </kanban>
                        </field>
                      </page>  
                </xpath>
                 
			</field>
		</record>
		
		<record id="view_project_task_work_summary_form" model="ir.ui.view">
            <field name="name">project.task.work.form</field>
            <field name="model">project.task.work.summary</field>
            <field name="arch" type="xml">
                <form string="Work Summary">
				<sheet>
                    <div class="oe_title">
                        <h1>
                            <label string="Work Summary"/>
                        </h1>
                    </div>
                     <group>
                        <group>
                            <field name="name"/>
							<field name="description"/>
                        </group>
                     </group>
				</sheet>
                </form>
            </field>
        </record>

       <record id="project_task_work_summary_search" model="ir.ui.view">
            <field name="name">project.task.work.search</field>
            <field name="model">project.task.work.summary</field>
            <field name="arch" type="xml">
                <search string="Search Work Summary">
                    <field name="name"/>
					<field name="description"/>
                </search>
            </field>
        </record>
 
         <record id="project_task_work_summary_tree" model="ir.ui.view">
            <field name="name">project.task.work.tree</field>
            <field name="model">project.task.work.summary</field>
            <field name="arch" type="xml">
                <tree string="Work Summary">
                    <field name="name"/>
					<field name="description"/>
                </tree>
            </field>
        </record>


		<record id="project_task_work_summary_action" model="ir.actions.act_window">
            <field name="name">Work Summary</field>
            <field name="type">ir.actions.act_window</field>
            <field name="res_model">project.task.work.summary</field>
            <field name="view_mode">tree,form</field>
            <field name="search_view_id" ref="project_task_work_summary_search"/>
            <field name="help" type="html">
              <p class="oe_view_nocontent_create">
                Click to create a new work summary entries.
              </p>
            </field>
        </record>
		
		<menuitem action="project_task_work_summary_action" 
			id="menu_project_task_work_summary" 
			parent="base.menu_definitions"
			sequence="2"/>
		
	</data>
</openerp>


